package com.michael.retail.sys.api.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 类功能描述:
 * <pre>
 *   系统用户类
 * </pre>
 *
 * @author Michael
 * @version 1.0
 * @date 2021/7/5 20:17
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_user")
public class SysUser {

    private static final int STATUS_OK = 0;

    @TableId(type = IdType.AUTO)
    private Long id;

    private String username;

    private String password;

    private String nickname;

    private String mobile;

    private Integer gender;

    private String email;

    private Integer status;

    /** 用户权限 */
    @TableField(exist = false)
    private List<String> authorities;

    public boolean isEnable() {
        return STATUS_OK == status;
    }

}
